const express = require('express');
const router = express.Router();
// 引进mockjs
const Mock = require('mockjs');

// 监听路由
router.get('/list', (req, res) => {
    // 准备随机数据
    var data = {
        code: 0,
        success: true,
        data: Mock.mock({
            'list|10': [
                {
                    'kaijiangId|+1': 1,
                    kaijiangName: '@ctitle(10)',
                    kaijiangImg: "@Image('300x100','@color','image')",
                },
            ],
            total: 30,
        }),
    };
    res.end(JSON.stringify(data));
});

module.exports = router;
